package com.jfzt.controller;

import com.alibaba.fastjson2.JSONObject;
import com.jfzt.utils.ElasticsearchServiceImplUtils;

/**
 * @author: shunpeng.hu
 * @date: 2024/3/6 11:10
 */
public class TestES {

    public static void main(String[] args) {

        JSONObject document = new JSONObject();
        document.put("kcAdmin", "admin.hr");
        document.put("kcRealm", "HRApp");
        document.put("kcClient", "");
        // 添加任务到队列
        ElasticsearchServiceImplUtils.addTaskToQueue("keycloak_util_dev", document);

        // 执行任务
        ElasticsearchServiceImplUtils.executeTasks();

        // 关闭线程池和队列
        ElasticsearchServiceImplUtils.executorService.shutdown();
    }
}
